package com.example.actuator.service;

import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.binder.MeterBinder;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class PrometheusMeter {
    private double getVal() {
        return 1.0D;
    }

    @Bean
    public MeterBinder selfInitMetrics() {
        return registry -> Gauge.builder("self_init_metrics", this::getVal)
                .description("this is a description")
                .tag("tagName", "tagVal")
                .register(registry);
    }
}
